<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const arr = [
            { name: '曹操', age: 1000 },
            { name: '刘备', age: 1256 },
            { name: '孙权', age: 857 },
            { name: "孙尚尚", age: 1234 }
        ]
        //利用reduce方法求age总和
        const result = arr.reduce((pre, cur) => {
            return pre + cur.age
        }, 0)
        console.log(result)  //4347
    </script>
</body>

</html>